package hpp.meituanTest;

import java.util.Scanner;

/**
 * Created by hpp on 2017/8/27.
 */
public class AverageAge {

    public static void main(String[] args) {
        ;
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int w = scanner.nextInt();
            double y = scanner.nextDouble();
            double x = scanner.nextDouble();
            int n = scanner.nextInt();
            System.out.println(countAverageAge(w,y,x,n));
        }

    }
    public static int countAverageAge(int w,double y,double x,int n) {
        for (int i = 0;i<n;i++){
            y = (y + 1) *(1 - x) +  x * 21;
        }
        return (int)Math.ceil(y);
    }

}
